<?php

declare (strict_types=1);

namespace app\api\validate;

class UserValidate extends BaseValidate
{
    /**
     * 定义验证规则
     * 格式：'字段名' =>  ['规则1','规则2'...]
     *
     * @var array
     */
    protected $rule = [
        'username|用户名' => 'require|length:6,32|alphaNum',
        'password|密码' => 'require|length:6,32',
    ];

    /**
     * 定义错误信息
     * 格式：'字段名.规则名' =>  '错误信息'
     *
     * @var array
     */
    protected $message = [];


    public function sceneLogin()
    {
        //sreturn $this->append('username', 'unique:user,username');
    }

    public function sceneRegister()
    {
        //return $this->append('username', 'unique:user,username');
    }
}
